
import clz.DB;
import java.sql.CallableStatement;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.logging.Level;
import java.util.logging.Logger;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Hishan
 */
public class CreateProc {
    public static void main(String[] args) {
        int[] executeBatch = null;
        try {
            
            //CallableStatement prepareCall = DB.getConnection().prepareCall();
            Statement s = DB.getConnection().createStatement();
//            s.addBatch("DELIMITER $$");
//            s.addBatch("CREATE PROCEDURE `anuradhaa` ()");
//            s.addBatch("BEGIN");
//            s.addBatch("select * from images; ");
//            s.addBatch("END");
//            s.addBatch("DELIMITER ;");
            s.execute("DROP PROCEDURE IF EXISTS vbf()");
            s.execute("CREATE PROCEDURE vbf()"
                    + " BEGIN"
                    + " select * from images;"
                    + " END");
            //executeBatch = s.executeBatch();
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(CreateProc.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            ex.printStackTrace();
        }
    }
}
